<%--
  Created by IntelliJ IDEA.
  User: 22531
  Date: 2021/5/23
  Time: 16:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Login</title>
    <link rel="stylesheet" type="text/css" href="/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="/js/LoginCSS.css">
    <script type="text/javascript" src="/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="/easyui/jquery.easyui.min.js"></script>
    <script src="/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">
        function refresh() {
            ff.imgValidate.src = "/getVCode?id="+Math.random();
        }
    </script>
</head>
<body>
<div class="login-form">
    <form name="ff" action="" method="post">
        <h2 style="text-align: center">用户登录</h2>
        <div style="margin-bottom:10px">
            <p>${msg}</p>
        </div>

        <div style="margin-bottom:10px">
            <input class="easyui-textbox" name="name" style="width:100%;height:40px;padding:12px" data-options="prompt:'Username',iconCls:'icon-man',iconWidth:38,required:true">
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" name="password" type="password" style="width:100%;height:40px;padding:12px" data-options="prompt:'Password',iconCls:'icon-lock',iconWidth:38,required:true">
        </div>

        <div style="margin-bottom:20px;text-align: center">
            <input class="easyui-radiobutton" name="user" value="1" label="学生" labelAlign="left" checked="true" labelPosition="after">
            <input class="easyui-radiobutton" name="user" value="2" label="管理员" labelAlign="left" labelPosition="after">
            <input class="easyui-radiobutton" name="user" value="3" label="老师" labelAlign="left" labelPosition="after">
        </div>


        <div style="margin-bottom:20px;text-align: center">
            <img name="imgValidate" border=0 src="/getVCode" style="width:25%;height:40px;padding:2px;vertical-align:middle" onclick="refresh()">
            <input class="easyui-textbox" name="vCode" style="width:70%;height:40px;padding:12px;vertical-align:middle" data-options="prompt:'验证码',required:true">
        </div>


        <div style="text-align:center;padding:5px 0">
            <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:80px">login</a>
        </div>
    </form>
</div>
<script>
    function submitForm() {
        var num = document.ff.user.value
        if (num == 1) {
            document.ff.action = "/stuLogin"
        }else if (num==2){
            document.ff.action = "/adminLogin"
        }else {
            document.ff.action = "/teaLogin"
        }
        document.ff.submit();
    }
</script>
</body>
</html>
